// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios'
import '../static/rembuju.js'
import '../static/reset.css'
import 'swiper/dist/css/swiper.css';
// import ElementUI from 'element-ui';
// import 'element-ui/lib/theme-chalk/index.css';
import VueAwesomeSwiper from 'vue-awesome-swiper';


// Vue.use(ElementUI);
Vue.use(VueAwesomeSwiper)
// import { Switch } from 'mint-ui';
// Vue.component(Switch.name, Switch);
// import MuseUI from 'muse-ui'
// Vue.use(MuseUI)

//引入swiper
// import 'swiper/dist/css/swiper.min.css'

Vue.config.productionTip = false


/* 统一拦截器开始 */
router.beforeEach((to, from, next) => {
  if(to.meta.requireAuth){// 代表需要登录
    //判断有没有登录
    if(sessionStorage.getItem('userInfo')){//有值，代表登录过了
      next();
    }else{
      next({
        path:'Login',
        query: {
          redirect: to.fullPath
        }
      });
    }
  }else{
    next();
  }
  
})
/* 统一拦截器结束 */

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
